import Component from './component.js';
class RedBlueButton extends Component {
    constructor(props) {
        super(props);
        this.state = {
            color: 'red'
        }
    }

    onClick() {
        this.setState({
            color: 'blue'
        })
    }
    render() {
        return ` <div style="color:${this.state.color}">${this.state.color=='red'?'红色':'蓝色'}</div> `
    }
}

export default RedBlueButton;